{extend name="$_admin_base_layout" }
{block name='content'}

<form class="" method="post" action="">
    <div>
        <div class="form-group">
            <label for="order_numbers">&nbsp&nbsp&nbsp&nbsp排序</label>
            <input type="number" class="form-control" id="order_numbers" placeholder="排序" value="{$express['number_orders']}">
        </div>
        <div class="form-group">
            <label for="dispatchname">&nbsp&nbsp&nbsp&nbsp配送方式名称</label>
            <input type="text" class="form-control" name="dispatchname" id="dispatchname" value="{$express['dispatchname']}" placeholder="配送方式名称" required>
        </div>
        <div class="form-group">
            <label for="express">&nbsp&nbsp&nbsp&nbsp物流公司</label>
            <select name="express"  id="express" class="form-control input-smedium">
                <option value="" data-name="其他快递" >其他快递</option>
                <option value="shunfeng" data-name="顺丰" {$express['express']=='shunfeng'?'selected':''}>顺丰</option>
                <option value="shentong" data-name="申通"  {$express['express']=='shentong'?'selected':''}>申通</option>
                <option value="yunda" data-name="韵达快运" {$express['express']=='yunda'?'selected':''}>韵达快运</option>
                <option value="tiantian" data-name="天天快递" {$express['express']=='tiantian'?'selected':''}>天天快递</option>
                <option value="yuantong" data-name="圆通速递" {$express['express']=='yuantong'?'selected':''}>圆通速递</option>
                <option value="zhongtong" data-name="中通速递" {$express['express']=='zhongtong'?'selected':''}>中通速递</option>
                <option value="ems" data-name="ems快递" {$express['express']=='ems'?'selected':''}>ems快递</option>
                <option value="huitongkuaidi" data-name="汇通快运" {$express['express']=='huitongkuaidi'?'selected':''}>汇通快运</option>
                <option value="quanfengkuaidi" data-name="全峰快递" {$express['express']=='quanfengkuaidi'?'selected':''}>全峰快递</option>
                <option value="zhaijisong" data-name="宅急送"> {$express['express']=='zhaijisong'?'selected':''}宅急送</option>
                <option value="aae" data-name="aae全球专递" {$express['express']=='aae'?'selected':''}>aae全球专递</option>
                <option value="anjie" data-name="安捷快递" {$express['express']=='anjie'?'selected':''}>安捷快递</option>
                <option value="anxindakuaixi" data-name="安信达快递" {$express['express']==''?'selected':''}>安信达快递</option>
                <option value="biaojikuaidi" data-name="彪记快递" {$express['express']=='biaojikuaidi'?'selected':''}>彪记快递</option>
                <option value="bht" data-name="bht" {$express['express']==''?'selected':''}>bht</option>
                <option value="baifudongfang" data-name="百福东方国际物流" {$express['express']=='baifudongfang'?'selected':''}>百福东方国际物流</option>
                <option value="coe" data-name="中国东方（COE）" {$express['express']=='coe'?'selected':''}>中国东方（COE）</option>
                <option value="changyuwuliu" data-name="长宇物流" {$express['express']=='changyuwuliu'?'selected':''}>长宇物流</option>
                <option value="datianwuliu" data-name="大田物流" {$express['express']==''?'selected':''}>大田物流</option>
                <option value="debangwuliu" data-name="德邦物流" {$express['express']=='debangwuliu'?'selected':''}>德邦物流</option>
                <option value="dhl" data-name="dhl" {$express['express']=='dhl'?'selected':''}>dhl</option>
                <option value="dpex" data-name="dpex" {$express['express']==''?'selected':''}>dpex</option>
                <option value="dsukuaidi" data-name="d速快递" {$express['express']=='dsukuaidi'?'selected':''}>d速快递</option>
                <option value="disifang" data-name="递四方" {$express['express']==''?'selected':''}>递四方</option>
                <option value="fedex" data-name="fedex（国外）" {$express['express']=='fedex'?'selected':''}>fedex（国外）</option>
                <option value="feikangda" data-name="飞康达物流" {$express['express']==''?'selected':''}>飞康达物流</option>
                <option value="fenghuangkuaidi" data-name="凤凰快递" {$express['express']==''?'selected':''}>凤凰快递</option>
                <option value="feikuaida" data-name="飞快达" {$express['express']=='feikuaida'?'selected':''}>飞快达</option>
                <option value="guotongkuaidi" data-name="国通快递" {$express['express']=='guotongkuaidi'?'selected':''}>国通快递</option>
                <option value="ganzhongnengda" data-name="港中能达物流" {$express['express']=='ganzhongnengda'?'selected':''}>港中能达物流</option>
                <option value="guangdongyouzhengwuliu" data-name="广东邮政物流" {$express['express']=='guangdongyouzhengwuliu'?'selected':''}>广东邮政物流</option>
                <option value="gongsuda" data-name="共速达" {$express['express']=='gongsuda'?'selected':''}>共速达</option>
                <option value="hengluwuliu" data-name="恒路物流" {$express['express']=='hengluwuliu'?'selected':''}>恒路物流</option>
                <option value="huaxialongwuliu" data-name="华夏龙物流" {$express['express']=='huaxialongwuliu'?'selected':''}>华夏龙物流</option>
                <option value="haihongwangsong" data-name="海红" {$express['express']=='haihongwangsong'?'selected':''}>海红</option>
                <option value="haiwaihuanqiu" data-name="海外环球" {$express['express']=='haiwaihuanqiu'?'selected':''}>海外环球</option>
                <option value="jiayiwuliu" data-name="佳怡物流" {$express['express']=='jiayiwuliu'?'selected':''}>佳怡物流</option>
                <option value="jinguangsudikuaijian" data-name="京广速递" {$express['express']=='jinguansudikuaijian'?'selected':''}>京广速递</option>
                <option value="jixianda" data-name="急先达" {$express['express']=='jixianda'?'selected':''}>急先达</option>
                <option value="jjwl" data-name="佳吉物流" {$express['express']=='jjwl'?'selected':''}>佳吉物流</option>
                <option value="jymwl" data-name="加运美物流" {$express['express']=='jymwl'?'selected':''}>加运美物流</option>
                <option value="jindawuliu" data-name="金大物流" {$express['express']=='jindawuliu'?'selected':''}>金大物流</option>
                <option value="jialidatong" data-name="嘉里大通" {$express['express']=='jialidatong'?'selected':''}>嘉里大通</option>
                <option value="jykd" data-name="晋越快递" {$express['express']=='jykd'?'selected':''}>晋越快递</option>
                <option value="kuaijiesudi" data-name="快捷速递" {$express['express']=='kuaijiesudi'?'selected':''}>快捷速递</option>
                <option value="lianb" data-name="联邦快递（国内）" {$express['express']=='lianb'?'selected':''}>联邦快递（国内）</option>
                <option value="lianhaowuliu" data-name="联昊通物流" {$express['express']=='lianhaowuliu'?'selected':''}>联昊通物流</option>
                <option value="longbangwuliu" data-name="龙邦物流" {$express['express']=='longbangwuliu'?'selected':''}>龙邦物流</option>
                <option value="lijisong" data-name="立即送" {$express['express']=='lijisong'?'selected':''}>立即送</option>
                <option value="lejiedi" data-name="乐捷递" {$express['express']=='lejiedi'?'selected':''}>乐捷递</option>
                <option value="minghangkuaidi" data-name="民航快递" {$express['express']=='minhangkuaidi'?'selected':''}>民航快递</option>
                <option value="meiguokuaidi" data-name="美国快递" {$express['express']=='meiguokuaidi'?'selected':''}>美国快递</option>
                <option value="menduimen" data-name="门对门" {$express['express']=='menduimen'?'selected':''}>门对门</option>
                <option value="ocs" data-name="OCS" {$express['express']=='ocs'?'selected':''}>OCS</option>
                <option value="peisihuoyunkuaidi" data-name="配思货运" {$express['express']=='peisihuokuaidi'?'selected':''}>配思货运</option>
                <option value="quanchenkuaidi" data-name="全晨快递" {$express['express']=='quanchengkuaidi'?'selected':''}>全晨快递</option>
                <option value="quanjitong" data-name="全际通物流" {$express['express']=='quanjitong'?'selected':''}>全际通物流</option>
                <option value="quanritongkuaidi" data-name="全日通快递" {$express['express']=='quanritongkuaidi'?'selected':''}>全日通快递</option>
                <option value="quanyikuaidi" data-name="全一快递" {$express['express']=='quanyikuaidi'?'selected':''}>全一快递</option>
                <option value="rufengda" data-name="如风达" {$express['express']=='rufengda'?'selected':''}>如风达</option>
                <option value="santaisudi" data-name="三态速递" {$express['express']=='santaisudi'?'selected':''}>三态速递</option>
                <option value="shenghuiwuliu" data-name="盛辉物流" {$express['express']=='shenghuiwuliu'?'selected':''}>盛辉物流</option>
                <option value="sue" data-name="速尔物流" {$express['express']=='sue'?'selected':''}>速尔物流</option>
                <option value="shengfeng" data-name="盛丰物流" {$express['express']=='shengfeng'?'selected':''}>盛丰物流</option>
                <option value="saiaodi" data-name="赛澳递" {$express['express']=='saiaodi'?'selected':''}>赛澳递</option>
                <option value="tiandihuayu" data-name="天地华宇" {$express['express']=='tiandihuayu'?'selected':''}>天地华宇</option>
                <option value="tnt" data-name="tnt" {$express['express']=='tnt'?'selected':''}>tnt</option>
                <option value="ups" data-name="ups" {$express['express']=='ups'?'selected':''}>ups</option>
                <option value="wanjiawuliu" data-name="万家物流" {$express['express']=='wanjiawuliu'?'selected':''}>万家物流</option>
                <option value="wenjiesudi" data-name="文捷航空速递" {$express['express']==''?'selected':''}>文捷航空速递</option>
                <option value="wuyuan" data-name="伍圆" {$express['express']==''?'selected':''}>伍圆</option>
                <option value="wxwl" data-name="万象物流" {$express['express']=='wxwl'?'selected':''}>万象物流</option>
                <option value="xinbangwuliu" data-name="新邦物流" {$express['express']=='xinbangwuliu'?'selected':''}>新邦物流</option>
                <option value="xinfengwuliu" data-name="信丰物流" {$express['express']==''?'selected':''}>信丰物流</option>
                <option value="yafengsudi" data-name="亚风速递" {$express['express']=='yafengsudi'?'selected':''}>亚风速递</option>
                <option value="yibangwuliu" data-name="一邦速递" {$express['express']==''?'selected':''}>一邦速递</option>
                <option value="youshuwuliu" data-name="优速物流" {$express['express']=='youshuwuliu'?'selected':''}>优速物流</option>
                <option value="youzhengguonei" data-name="邮政包裹挂号信" {$express['express']=='youzhengguonei'?'selected':''}>邮政包裹挂号信</option>
                <option value="youzhengguoji" data-name="邮政国际包裹挂号信" {$express['express']=='youzhengguoji'?'selected':''}>邮政国际包裹挂号信</option>
                <option value="yuanchengwuliu" data-name="远成物流" {$express['express']=='yuanchengwuliu'?'selected':''}>远成物流</option>
                <option value="yuanweifeng" data-name="源伟丰快递" {$express['express']=='yuanweifeng'?'selected':''}>源伟丰快递</option>
                <option value="yuanzhijiecheng" data-name="元智捷诚快递" {$express['express']=='yuanzhijiecheng'?'selected':''}>元智捷诚快递</option>
                <option value="yuntongkuaidi" data-name="运通快递" {$express['express']=='yuntongkuaidi'?'selected':''}>运通快递</option>
                <option value="yuefengwuliu" data-name="越丰物流" {$express['express']=='yuefengwuliu'?'selected':''}>越丰物流</option>
                <option value="yad" data-name="源安达" {$express['express']==''?'selected':''}>源安达</option>
                <option value="yinjiesudi" data-name="银捷速递" {$express['express']=='yinjiesudi'?'selected':''}>银捷速递</option>
                <option value="zhongtiekuaiyun" data-name="中铁快运" {$express['express']=='zhongtiekuaiyun'?'selected':''}>中铁快运</option>
                <option value="zhongyouwuliu" data-name="中邮物流" {$express['express']=='zhongyouwuliu'?'selected':''}>中邮物流</option>
                <option value="zhongxinda" data-name="忠信达" {$express['express']=='zhongxinda'?'selected':''}>忠信达</option>
                <option value="zhimakaimen" data-name="芝麻开门" {$express['express']=='zhimakaimen'?'selected':''}>芝麻开门</option>
            </select>
        </div>
        <div class="form-group">
            <label for="">&nbsp&nbsp&nbsp&nbsp是否显示</label>

            <label class="radio-inline">
                <input type="radio" name="status"  value="1" checked> 是
            </label>
            <label class="radio-inline">
                <input type="radio" name="status"  value="2" {$express['status']=2?'checked':''}> 否
            </label>
        </div>

        <div class="form-group">
            <label for="">&nbsp&nbsp&nbsp&nbsp配送类型</label>

            <label class="radio-inline">
                <input type="radio" name="dispatchtype"  value="1" checked> 商家配送
            </label>
            <label class="radio-inline">
                <input type="radio" name="dispatchtype"  value="2"> 自提
            </label>
        </div>
        <div class="form-group ">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label">配送区域</label>
            <div class="col-sm-9 col-xs-12">
                <table>
                    <thead>
                    <tr>
                        <th style="height:40px;width:400px;">运送到</th>
                        <th style="width:120px;">首重(克)</th>
                        <th style="width:120px;">首费(元)</th>
                        <th style="width:120px;">续重(克)</th>
                        <th style="width:120px;">续费(元)</th>
                        <th style="width:120px;">管理</th>
                    </tr>
                    </thead>
                    <tbody id="tbody-areas">
                    {foreach $areas as $key=>$v}
                    <tr>
                    <td style="padding:10px;"><input type="hidden" value="{$v['city']}" class="form-control" name="areas[{$key}][city]" style="width:100px;" min="0">{$v['city']}</td>
                    <td class="text-center">
                        <input type="number"  class="form-control" name="areas[{$key}][default_firstweight]" value="{$v['default_firstweight']}" style="width:100px;" min="0" required></td>
                    <td class="text-center">
                        <input type="text" class="form-control" name="areas[{$key}][default_firstprice]" value="{$v['default_firstprice']}" style="width:100px;" min="0" required></td>
                    <td class="text-center">
                        <input type="number"  class="form-control" name="areas[{$key}][default_secondweight]" value="{$v['default_secondweight']}" style="width:100px;" min="0" required></td>
                    <td class="text-center">
                        <input type="text"  class="form-control" name="areas[{$key}][default_secondprice]" value="{$v['default_secondprice']}" style="width:100px;" min="0" required></td>
                    <td><span class='glyphicon glyphicon-remove express_remove' onclick='express_remove($(this))'></span></td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
                <a class="btn btn-default" href="javascript:;" onclick="addArea()"><span class="fa fa-plus"></span> 新增配送区域</a>
                <span class="help-i">根据重量来计算运费，当物品不足《首重重量》时，按照《首重费用》计算，超过部分按照《续重重量》和《续重费用》乘积来计算</span><br>
                <span class="help-i"><button class="submit btn-primary">提交</button></span>
            </div>
        </div>
    </div>

    <script>
        var  i={$areasnum};
        function addArea() {
            var j=i++;
            $('#tbody-areas').append("<tr><td style='padding:10px;'><input type='text' value='' class='form-control' name='areas["+j+"][city]' style='width: 100px' placeholder='请输入省份' required></td>" +
                "<td class='text-center'><input type='number' value='' class='form-control' name='areas["+j+"][default_firstweight]' style='width: 100px' min='0' required></td>" +
                "<td class='text-center'><input type='text' value='' class='form-control' name='areas["+j+"][default_firstprice]' style='width: 100px' min='0' required></td>" +
                "<td class='text-center'><input type='number' value='' class='form-control' name='areas["+j+"][default_secondweight]' style='width: 100px' min='0' required></td>" +
                "<td class='text-center'><input type='text' value='' class='form-control' name='areas["+j+"][default_secondprice]' style='width: 100px' min='0' required></td>" +
                "<td><span class='glyphicon glyphicon-remove express_remove' onclick='express_remove($(this))'></span> </td></tr>")
        }

        function express_remove(obj) {
            obj.parent().parent().remove();
        }
    </script>


    {/block}